/*
 * 根据id删除数据
 */
function addToBuy(id){
	var cardNo=document.getElementById("cardNo").value;
	var sellNum=document.getElementById("sellNum"+id).value;
	
	alert(sellNum);
	
	
}

//审核通过
function passById(prefix,id){
	if(!window.confirm("确认审核？")){
		return ;
	}
	
	var url=prefix+"/supplierProduct/pass";
	$.post(url,{"id":id},function(data){
		alert("操作成功");
		location.reload(true);
	},'json');
}
/*
 * 根据多个id删除数据
 * @param {Object} prefix
 */
function delByIds(prefix){
	
	var str="";
	var checkArray = document.getElementsByName("chk");
	for (var i = 0; i < checkArray.length; i++) {
		if(checkArray[i].checked){
			str += checkArray[i].value + ",";
		}
	}
	var dot = str.lastIndexOf(",");
	if(dot==-1){
		alert("请选择要删除的商品");
		return;
	}else{
		str = str.substring(0,dot);
	}
	
	if(!window.confirm("确认删除？")){
		return;
	}
	
	var url=prefix+"/supplierProduct/deleteMany";
	$.post(url,{"idStr":str,},function(data){
		location.reload(true);
	},'json');
	
}

/*
 * 根据多个id审批通过数据
 * @param {Object} prefix
 */
function passByIds(prefix){
	
		var str="";
		var checkArray = document.getElementsByName("chk");
		for (var i = 0; i < checkArray.length; i++) {
			if(checkArray[i].checked){
				str += checkArray[i].value + ",";
			}
		}
		var dot = str.lastIndexOf(",");
		if(dot==-1){
			alert("请选择要审核的商品。");
			return;
		}else{
			str = str.substring(0,dot);
		}
		
		if(!window.confirm("确认审核通过？")){
			return;
		}
	
	var url=prefix+"/supplierProduct/passMany";
	$.post(url,{"idStr":str},function(data){
		location.reload(true);
	},'json');
	
}